package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysField;
import com.jk.smartelderlycare.interfaces.SysFieldServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysFieldService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysFiedController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/18 14:31
 */
@Slf4j
@RestController
public class SysFiedController implements SysFieldServiceApi {
    @Autowired
    private SysFieldService sysFieldService;
    @Override
    public PagedResponse<SysField> findSysFieldPaginationList(SysField sysField, Integer pageNum, Integer pageSize) {
        return sysFieldService.findSysFieldPaginationList(sysField,pageNum,pageSize);
    }
    /**
     * @description: 新增
     * @param: [sysField]
     * @return: void
     * @author hhk
     * @date: 2024/11/18 14:32
     */
    @Override
    public void addSysField(SysField sysField) {
        sysFieldService.addSysField(sysField);
    }
    /**
     * @description: 根据id删除一条数据
     * @param: [fieldId]
     * @return: void
     * @author hhk
     * @date: 2024/11/18 14:33
     */
    @Override
    public void deleteSysFieldByFieldId(Long fieldId) {
        sysFieldService.deleteSysFieldByFieldId(fieldId);
    }
    /**
     * @description: 根据id回显一条数据
     * @param: [fieldId]
     * @return: com.jk.smartelderlycare.dto.SysField
     * @author hhk
     * @date: 2024/11/18 14:33
     */
    @Override
    public SysField findSysFieldById(Long fieldId) {
        return sysFieldService.findSysFieldById(fieldId);
    }
    /**
     * @description: 修改
     * @param: [sysField]
     * @return: void
     * @author hhk
     * @date: 2024/11/18 14:33
     */
    @Override
    public void updataSysField(SysField sysField) {
        sysFieldService.updataSysField(sysField);
    }
    /**
     * @description: 状态修改
     * @param: [sysField]
     * @return: void
     * @author hhk
     * @date: 2024/11/18 14:36
     */
    @Override
    public void updateStatus(SysField sysField) {
        sysFieldService.updateStatus(sysField);
    }
}
